<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <link rel="shortcut icon" href="../../src/images/bitbug_favicon.ico" type="image/x-icon">
  <meta name="keywords" content="your keywords">
  <meta name="description" content="your description">
  <meta name="author" content="author,email address">
  <meta name="robots" content="index,follow">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="renderer" content="ie-stand">
  <title>仁和区党群服务一号通暨群众意见受理中心</title>
  <link rel="stylesheet" href="../../src/js/libs/laypage/skin/laypage.css">
  <link rel="stylesheet" href="../../src/css/base.css">
  <link rel="stylesheet" href="../../src/css/common.css">
  <link rel="stylesheet" href="../../src/css/tpl.css">
  <link rel="stylesheet" href="../../src/css/user_center.css">
  <style>
    .nd_container {
      margin-top: 40px;
    }

    .nd_container .title {
      text-align: center;
      font-size: 24px;
      font-weight: bold;
      margin-bottom: 20px;
    }

    .nd_container .sub_title {
      font-size: 16px;
      color: #999;
      margin-right: 20px;
      margin-bottom: 30px;
      text-align: center;
    }

    .nd_container .content img {
      clear: both;
      margin-bottom: 15px;
      width: 100%;
      float: left;
    }

    .nd_container .content p {
      line-height: 1.5em;
      font-size: 16px;
      color: #666;
      text-indent: 2em;
      margin: 20px 0;
    }

    #div_collect {
      border: 1px solid #eed8c3;
      width: 60px;
      height: 25px;
      text-align: center;
      line-height: 25px;
      cursor: pointer;
      background-color: #ffe5d0;
      float: right;
      margin: 30px 0px;
      color: #a2644d;
    }
  </style>
  <script src="../../src/js/libs/es5-shim.min.js"></script>
  <script src="../../src/js/libs/es5-sham.min.js"></script>
  <script src="../../src/js/libs/json3.min.js"></script>
</head>

<body>
  <div class="page">
    <div id="header"></div>

    <div class="menu-bar">
      <div class="container">
        <span>
          <span class="crumb-name">当前你的位置：</span>>
          <span>
            <a class="" href="../Home/Index.html">首页</a>>
          </span>
          <span>来件查询</span>
      </div>
    </div>
    <!--正文-->
    <div class="mid_container nd_container clearfix">
      <div class="left_guide">
        <h1 class="left_guide_top_size">
          在线民声
        </h1>
        <div class="left_guide_decorate">
        </div>
        <div class="left_about_us">
          THE VOICE OF THE PEOPLE
        </div>
        <div class="left_white_about">
          <a href="Goldidea.html" class="left_white_bottom">
            <span class="left_cn_about_us">金点子</span>
          </a>
        </div>
        <div class="left_white_about">
          <a href="Feedback.html" class="left_white_bottom">
            <span class="left_cn_about_us">建议意见</span>
          </a>
        </div>
        <div class="left_white_about">
          <a href="Notice.html" class="left_white_bottom">
            <span class="left_cn_about_us">民生投诉</span>
          </a>
        </div>
        <div class="left_white_about">
          <a href="SJMailbox.html" class="left_white_bottom">
            <span class="left_cn_about_us">书记信箱</span>
          </a>
        </div>
        <div class="left_white_about">
          <a href="QZMailbox.html" class="left_white_bottom">
            <span class="left_cn_about_us">区长信箱</span>
          </a>
        </div>
        <div class="left_white_about">
          <a href="Demanfar.html" class="left_white_bottom">
            <span class="left_cn_about_us">来件查询</span>
          </a>
        </div>
      </div>
      <div class="mid_guide">
        <div class="mid_guide_content">
          <div class="content clearfix" id="detail_html">

          </div>
        </div>
      </div>
    </div>
  </div>
  <div id="footer"></div>

  <script id="detail_tpl" type="text/html">
    <div class="title">{{data.title}}</div>
    <div class="audit_info_row clearfix" style="margin-bottom:15px;">
      <div class="fl left ">来信时间：</div>
      <div class="right">
        {{data.createtime}}
      </div>
    </div>
    <div class="audit_info_row clearfix" style="margin-bottom:15px;">
      <div class="fl left ">回复时间：</div>
      <div class="right">
        {{data.operationtime}}
      </div>
    </div>
    <div class="audit_info_row clearfix" style="margin-bottom:15px;">
      <div class="fl left ">来信人：</div>
      <div class="right">
        {{data.username}}
      </div>
    </div>
    <div class="audit_info_row clearfix" style="margin-bottom:15px;">
      <div class="fl left ">信件类型：</div>
      <div class="right">
        {{data.appealtype | _appealtype}}
      </div>
    </div>
    <div class="audit_info_row clearfix" style="margin-bottom:15px;">
      <div class="fl left ">来信地址：</div>
      <div class="right">
        {{data.address}}
      </div>
    </div>
    <div class="audit_info_row clearfix" style="margin-bottom:15px;">
      <div class="fl left ">信件内容：</div>
      <div class="right unlimited">
        {{data.content}}
      </div>
    </div>
    <div class="audit_info_row clearfix" style="margin-bottom:15px;">
      <div class="fl left ">信件回复：</div>
      <div class="right unlimited feedbackresult">
        {{if data.feedbackresult == ''}}无{{/if}}
      </div>
    </div>
  </script>
  <script src="../../src/js/libs/jquery.1.12.4.js"></script>
  <script src="../../src/js/libs/template-web.js"></script>
  <script src="../../src/js/libs/layer/layer.js"></script>
  <script src="../../src/js/base/common.js"></script>
  <script>
    var params = {
      newsid: window.location.href.split('?')[1]
    }
    var pageindex = 4

    template.defaults.imports._appealtype = function (val) {
      var arr = ['投诉', '监督', '举报', '曝光', '表扬', '建议', '其他']
      val = parseInt(val) - 1
      return arr[val] ? arr[val] : '其他'
    };
    
    $.ajax({
      url: 'http://221.10.2.222:5680/api/ow/Complain/Model/' + params.newsid,
      type: "GET",
      dataType: "json",
      success: function (res) {
        console.log(res)
        var data = {
          data: res
        }
        if (res.source == '6') {
          $('.left_white_about').eq(4).addClass('active')
        } else if (res.source == '5') {
          $('.left_white_about').eq(3).addClass('active')
        } else {
          $('.left_white_about').eq(5).addClass('active')
        }
        data.data.feedbackresult = textareaTo(data.data.feedbackresult)
        var detail = template('detail_tpl', data)
        document.getElementById('detail_html').innerHTML = detail;
        $('.feedbackresult').html(data.data.feedbackresult)
      }
    })

    function textareaTo(str) {
      var reg = new RegExp("\n", "g");
      var regSpace = new RegExp(" ", "g");

      str = str.replace(reg, "<br>");
      str = str.replace(regSpace, "&nbsp;");

      return str;
    }
  </script>
</body>

</html>